<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <#include "../common/header.ftl">
    <script src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <script src="/js/plugins/echarts/echarts.common.min.js"></script>
</head>
<script>
    $(function () {
        $('#pagination').twbsPagination({
            totalPages:${result.pages},
            startPage:${result.pageNum},
            visiblePages:${result.pageSize},
            first:"首页",
            prev:"上一页",
            next:"下一页",
            last:"莫邪",

            onPageClick:function(event,page){
                $('#currentPage').val(page);
                $("#searchForm").submit();
            }
        });

        $(".chartBtn").click(function () {
            $("#myModal").removeData("bs.modal")
            var url = "/chart/list_bar.do?"+$("#searchForm").serialize()
            $("#myModal").modal({remote:url})
        })

        $(".bingBtn").click(function () {
            $("#myModal").removeData("bs.modal")
            var url = "/chart/list_bing.do?"+$("#searchForm").serialize()
            $("#myModal").modal({remote:url})
        })


    })



    
</script>
<body>

<div class="container " style="margin-top: 20px">
<#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-3">
        <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">部門管理</h1>
                </div>

            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/chart/list.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <div class="form-group">
                    <label for="keyword">员工姓名:</label>
                    <input type="text" class="form-control" id="keyword" name="keyword" value="${(qo.keyword)!}"
                           placeholder="请输入姓名">
                </div>
                <div class="form-group">
                    <label for="beginTime">时间段查询:</label>
                    <input type="text" class="form-control" id="beginTime" name="beginTime" value="${((qo.beginTime)?string('yyyy-MM-dd'))!}" onclick="WdatePicker()">-
                    <input type="text" class="form-control" id="endTime" name="endTime" value="${((qo.endTime)?string('yyyy-MM-dd'))!}" onclick="WdatePicker()">
                </div>

                <div class="form-group">
                    <label for="groupType">分组类型:</label>
                    <select class="form-control" id="groupType" name="groupType">
                    <#list groupTypes?keys as k >
                        <option value="${(k)!}" <#if k=="${qo.groupType}">
                            selected
                        </#if>>${(groupTypes[k])!}</option>
                    </#list>
                    </select>

                </div>
                <button id="btn_query" class="btn btn-default">查询</button>
            </form>
                <a class="btn btn-info btn-xs chartBtn ">
                    <span class="glyphicon glyphicon-pencil "></span>柱状图
                </a>
                <a class="btn btn-info btn-xs bingBtn ">
                    <span class="glyphicon glyphicon-pencil "></span>饼状图
                </a>

            <table class="table table-striped table-hover" >
                <thead>
                    <tr>
                        <th>分组类型</th>
                        <th>潜在客户新增数</th>
                    </tr>
                </thead>
                   <#list result.list as entity>
                   <tr>
                       <td>${(entity.groupType)!}</td>
                       <td>${(entity.customerNum)!}</td>

                   </tr>
               </#list>
            </table>
            <div style="text-align: center;">
                <ul id="pagination" class="pagination"></ul>
            </div>
        </div>
    </div>
    </div>
</div>

<div class="modal fade " tabindex="-1" id="myModal" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


</body>
</html>